"""更新用户类型默认值

Revision ID: 1ccf54eb092c
Revises: 490d432b8114
Create Date: 2025-01-20 15:24:57.491438

"""
from typing import Sequence, Union

from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql

# revision identifiers, used by Alembic.
revision: str = '1ccf54eb092c'
down_revision: Union[str, None] = '490d432b8114'
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None


def upgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('users', sa.Column('userType', sa.Enum('NORMAL', 'VIP', 'ADMIN', name='usertype'), server_default=sa.text("'NORMAL'"), nullable=False))
    op.drop_column('users', 'user_type')
    # ### end Alembic commands ###


def downgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('users', sa.Column('user_type', postgresql.ENUM('NORMAL', 'VIP', 'ADMIN', name='usertype'), autoincrement=False, nullable=False, comment='用户类型'))
    op.drop_column('users', 'userType')
    # ### end Alembic commands ###
